<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-07-31 17:46:49
 * @LastEditTime: 2020-03-23 13:10:16
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/vant.css">
    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
    <script type="text/javascript" src="../../script/jquery.js"></script>
    <script type="text/javascript" src="../../script/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="../../script/vue.min.js"></script>
    <script type="text/javascript" src="../../script/vant.min.js"></script>
    <script type="text/javascript" src="../../script/fastclick.js"></script>
    <script type="text/javascript" src="../../script/base.js"></script>
    <style type="text/css">
        .remark {
            color: #e4622a;
            text-align: center;
            font-size: 13px;
            line-height: 30px;
            font-weight: 700;
        }

        .van-search {
            /* background: transparent !important; */
            padding: 6px 0;
            border-bottom: 1px solid #ebedf0;
        }

        /* .van-search__content {
			background: transparent
		} */

        .van-search__action {
            color: #cd1b21;
            font-size: 13px;
            font-weight: 700;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="init-full">
            <van-nav-bar class="head" title="客户签到" left-arrow @click-left="onClickLeft">
                <div slot="right" class="head-right">
                    <span @click="deletePlan" v-if="BDate >= FLD.getFormatDate(new Date()).split(' ')[0] && BHDeID">
                        <img src="../../image/lj.png" />
                    </span>
                </div>
            </van-nav-bar>
            <div class="body-no-bottom">
                <div class="content">

                </div>
                <van-loading v-if="showLoading" />
            </div>
        </div>
    </div>
</body>

<script type="text/javascript">
    var vm;
    apiready = function () {
        //$('.init-full').show();
        var userInfo = FLD.getUserInfo();

        var ClientID = api.pageParam.ClientID;

        var FStatus = api.pageParam.FStatus;

        var BDate = api.pageParam.BDate;

        var BHDeID = api.pageParam.BHDeID;

        vm = new Vue({
            el: '#app',
            data: {
                showLoading: false,
                ifConfirm: false,
                BDate: BDate,
                BHDeID:BHDeID
            },
            created: function () {
                this.openMapModule();
            },
            methods: {
                openMapModule() {
                    var that = this;
                    var appTop_ = parseInt(window.localStorage.getItem('safeAreaTop'));
                    var y = appTop_ ? (appTop_ + 40) : (appTop_ + 25);
                    if (FStatus == 1) {
                        var obj = {
                            S_ClientID: ClientID,
                            S_SDate: BDate
                        }

                        FLD.ajax('APP_QDJLBNC', obj, function (res) {
                            api.openFrame({
                                name: 'map',
                                url: '../map.html',
                                rect: {
                                    x: 0,
                                    y: y,
                                    w: api.winWidth,
                                    h: api.winHeight - y
                                },
                                pageParam: {
                                    y: y,
                                    type: '签到',
                                    ClientID: ClientID,
                                    historyData: res.ds[0],
                                    FStatus: FStatus
                                }
                            });

                        })
                    } else {
                        api.openFrame({
                            name: 'map',
                            url: '../map.html',
                            rect: {
                                x: 0,
                                y: y,
                                w: api.winWidth,
                                h: api.winHeight - y
                            },
                            pageParam: {
                                y: y,
                                type: '签到',
                                ClientID: ClientID,
                                FStatus: FStatus,
                                trip:api.pageParam.trip
                            }
                        });
                    }



                },
                deletePlan() {
                    var that = this;
                    var appTop_ = parseInt(window.localStorage.getItem('safeAreaTop'));
                    var y = appTop_ ? (appTop_ + 40) : (appTop_ + 25);
                    var frames = api.frames();
                    var new_frame = frames.filter(function (row) {
                        return row.name == 'frameDelete';
                    })
                    if (new_frame.length) {
                        api.closeFrame({
                            name: 'frameDelete'
                        });
                    } else {
                        api.openFrame({
                            name: 'frameDelete',
                            url: 'frameDelete.html',
                            rect: {
                                x: 0,
                                y: y,
                                w: api.winWidth,
                                h: api.winHeight - y
                            },
                            pageParam:{
                                BHDeID:BHDeID
                            }
                        });
                    }

                },
                onClickLeft() {
                    api.closeWin();
                }
            }
        })
    };
</script>

</html>